<!DOCTYPE html>
<!--
Copyright (c) 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/model/source_info/source_info.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  test('domain', function() {
    const urlDomains = {
      'http://www.google.com': 'http://www.google.com',
      'http://www.google.com/bla': 'http://www.google.com',
      'http://www.google.com:1234': 'http://www.google.com',
      'bad url': undefined
    };
    for (const url in urlDomains) {
      const sourceInfo = new tr.model.source_info.SourceInfo(url);
      assert.strictEqual(urlDomains[url], sourceInfo.domain);
    }
  });
});
</script>
